package com.spzx.product.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.product.api.domain.vo.CategoryVo;
import com.spzx.product.api.fallback.CategoryFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * @ClassName CategoryFeignClient
 * @Author 波
 * @Date 2024/8/4 10:55
 */
@FeignClient(contextId = "categoryFeignClient", path = "/category", value = ServiceNameConstants.PRODUCT_SERVICE, fallbackFactory = CategoryFeignClientFallbackFactory.class)
public interface CategoryFeignClient {
    @GetMapping("/getOneCategory")
    R<List<CategoryVo>> getOneCategory(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/tree")
    R<List<CategoryVo>> getCategoryTree(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
